#include"Map.h"

void test1(){
    MyMap::Map<int,int> m;
    m.insert(make_pair(3,3));
    m.insert(make_pair(2,2));
    m.insert(make_pair(1,1));

    MyMap::Map<int,int>::iterator it=m.begin();
    while(it!=m.end()){
        //(it->first)++;
        cout<<it->first<<" "<<it->second<<endl;
        ++it;
    }
    cout<<endl;

    m[3]=1;
    m[4];
    m[5]=100;
    for(auto e : m){
        cout<<e.first<<" "<<e.second<<endl;
    }
}

void test2(){
    MyMap::Map<string,string> dict;
    dict.insert(make_pair("string","字符串"));
    dict.insert(make_pair("vector","动态数组"));
    dict.insert(make_pair("sort","排序"));
    for(auto e : dict){
        cout<<e.first<<" "<<e.second<<endl;
    }
    cout<<endl;

    dict["string"]="动态字符串";
    dict["map"];
    dict["list"]="链表";

    for(auto e : dict){
        cout<<e.first<<" "<<e.second<<endl;
    }
}

int main(){
    test1();
    //test2();


    return 0;
}